Skip to content

Conversation

@smuppand
Copy link
Contributor

This PR improves the Ethernet validation flow to be less disruptive, less flaky, and easier to debug on both full userland images (NetworkManager/systemd-networkd) and minimal/kernel-only style images.
What changed

  • Ethernet/run.sh
    • Adds a fast-path: if an interface already has Link detected=yes and a valid IPv4 (non 169.254.x.x), the test skips bring-up + DHCP and directly validates connectivity via ping.
    • Keeps existing behavior: if a network manager is active, the script does not run udhcpc and instead waits for IP.
    • Improves debug logs for triage (interface snapshot + ping output).
  • functestlib.sh
    • Updates try_dhcp_client_safe() to skip DHCP when a valid IP already exists.
    • If systemctl is available and NetworkManager/systemd-networkd is active, it waits for IP rather than fighting the manager.
    • Retains the safe udhcpc script flow for minimal images and adds extra logging for DHCP decisions/outcome.
  • Why
    • Avoids re-running link bring-up/DHCP when the interface is already configured.
    • Prevents conflicts with network managers on full images.
    • Maintains usability on kernel/minimal environments where systemctl may not exist.
    • Better logging helps debug intermittent link/IP issues quickly in CI/LAVA.

- Add a fast-path: if Link detected=yes and a valid (non link-local) IPv4 is
  already present, skip link bring-up + IP acquisition and run ping directly.
- Keep existing manager-aware behavior: when NetworkManager/systemd-networkd
  is active (via systemctl), don’t run udhcpc; only wait for IP.
- Improve debug logs (ip-link / ethtool / ping output) for easier LAVA triage.
- Preserve PASS/FAIL/SKIP summary reporting per interface.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
- In try_dhcp_client_safe(), detect a valid (non link-local) IPv4 early and
  return success without launching DHCP again.
- When systemctl is available and NetworkManager/systemd-networkd is active,
  wait for IP instead of running udhcpc to avoid fighting the manager.
- Keep the udhcpc safe-script behavior for minimal images while improving
  debug visibility around DHCP decisions and outcomes.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Copy link

@bhargav0610 bhargav0610 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants